var bProductImgDefaultWinAdd;
var bProductImgDefaultFormAdd;
function addBProductImgDefault(){
	initBProductImgDefaultFormAdd();
	bProductImgDefaultWinAdd = Ext.create('Ext.Window',{
		layout:'fit',
		width:800,
		height:400,
		maximized:true,
		maximizable:true,
		minimizable:true,
		animateTarget:document.body,
		plain:true,
		modal:true,
		title:'添加商品默认图片信息',
		listeners:{
			minimize:function(win,opts){
				win.collapse();
			}
		},
		items:bProductImgDefaultFormAdd,
		buttons:[{
			text:'保存',
			itemId:'save',
			handler:function(button){
				submitForm(bProductImgDefaultFormAdd,'../bProductImgDefaultController/addBProductImgDefault',grid,bProductImgDefaultWinAdd,false,true);
			}
		},{
			text:'关闭',
			itemId:'close',
			handler:function(button){
				button.up('window').close();
			}
		}]
	});
	Ext.getCmp('b_product_id').setValue($('#b_product_id_').val());
	bProductImgDefaultWinAdd.show();
}
function initBProductImgDefaultFormAdd(){
	bProductImgDefaultFormAdd = Ext.create('Ext.FormPanel',{
		xtype:'form',
		waitMsgTarget:true,
		defaultType:'textfield',
		autoScroll:true,
		fieldDefaults:{
			labelWidth:70,
			labelAlign:'left',
			flex:1,
			margin:'2 5 4 5'
		},
		items:[
		{
			fieldLabel:'图片名称',
			xtype:'textfield',
			name:'b_product_img_name',
			maxLength:100,
			width:400
		},
		{
			fieldLabel:'类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型',
			name:'b_product_img_type',
			xtype:"combo",
            store:[["0","大图片"],["1","小图片"]],
            emptyText:"请选择",
            mode:"local",
            value:'0',
            triggerAction:"all",
            editable:false,
			hiddenName:'b_product_img_type',
			allowBlank:false,
			width:200
		},
		{
			fieldLabel:'状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态:',
			name:'b_product_img_status',
			xtype:"combo",
            store:[["0","可用"],["1","禁用"]],
            emptyText:"请选择",
            mode:"local",
            value:'0',
            triggerAction:"all",
            editable:false,
			hiddenName:'b_product_img_status',
			allowBlank:false,
			width:200
		},
		{
			fieldLabel:'商品编号',
			xtype:'textfield',
			id:'b_product_id',
			name:'b_product_id',
			maxLength:32,
			hidden:true,
			anchor:'100%'
		},
		{
			fieldLabel:'附件编号',
			xtype:'textfield',
			id:'xt_attachment_id',
			name:'xt_attachment_id',
			maxLength:32,
			hidden:true,
			anchor:'100%'
		},
		{
			fieldLabel:'图片宽度',
			xtype:'numberfield',
			value:'273',
			name:'b_product_img_width',
			width:200
		},
		{
			fieldLabel:'图片高度',
			xtype:'numberfield',
			value:'273',
			name:'b_product_img_height',
			width:200
		},
		{
			fieldLabel:'使用说明',
			xtype:'textareafield',
			name:'b_product_img_remark',
			maxLength:200,
			anchor:'80%'
		},
		{
			title:'上传图片',
		    xtype:'box',//或者xtype:'component',  
			fieldLabel:"图&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;片",
			id:'pic',
			padding:'2 5 4 80',
			autoEl:{  
		        tag:'img',			    
		        onclick:'clickHandler()',    
		        src:basePath+"/deng/images/default/default.jpg"
		    } 
		}
		]
	});
}
